@extends('layouts.app')

@section('content')
    <div class="container">
        <div class="row justify-content-center">

            <div class="col-md-9">
                <div class="card">
                    <div class="card-header">添加接口分类</div>
                    <div class="card-body">
                        @include('layouts._formerrors')
                        <form method="POST" action="{{ $type ? route('type.update', [$type]) : route('type.store') }}">
                            @if($type) <input type="hidden" name="_method" value="PUT"> @endif
                            <div class="form-group">
                                <label for="title">分类名称</label>
                                <input type="hidden" name="id" value="{{ $type->id ?? "" }}">
                                <input type="text" name="title" class="form-control" id="title" value="{{ $type->title ?? old('title') }}">
                            </div>
                            <button type="submit" class="btn btn-primary">提交</button>
                            @csrf
                        </form>
                    </div>
                </div>
            </div>
        </div>
    </div>
@endsection

@push('js')
    <script>
        $("#list-type").addClass('active');
    </script>
@endpush


